<template>
  <div>
    <!-- 请求发送失败 -->
    <div v-show="from=='1'" class="c-textAlign-c c-fs24 c-pt200 c-pb30 c-fc-gray">
      <img src="@/assets/i/wap/activity/emoji-19.png" class="c-center c-ww330">
      <p v-if="type='400'">请求发送失败</p>
      <p v-else>连接超时啦</p>
    </div>
    <!-- 活动下架了 -->
    <div v-show="from=='2'" class="c-textAlign-c c-fs24 c-pt200 c-fc-gray c-pv30">
      <img src="https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/assets/error-default-new.png" class="c-center c-ww330">
      <p class="c-pt20">活动已下架</p>
      <p class="c-pt5">请关注其他精彩活动</p>
    </div>
    <!-- 已出票，但活动被删除，活动下架了 -->
    <div v-show="from=='3'" class="c-textAlign-c c-fs28 c-pb30 c-flex-column c-aligni-center">
      <p class="c-pt80 c-fw500 c-pb40">您报名的活动已被下架</p>
      <p v-if="phone || teacherQrcode || teacherWechatId" class="c-fs24">如有疑问，请联系商家</p>
      <p v-if="teacherWechatId" class="c-fs24 c-pt10">班主任微信号：{{teacherWechatId}}</p>
      <p v-if="phone && !teacherQrcode" class="c-fs24 c-pt10">电话：{{phone}}</p>
      <img v-if="teacherQrcode" class="c-ww200 c-hh200 c-mt20" :src="$addXossFilter(teacherQrcode, '')" alt="">
      <p v-if="teacherQrcode" class="c-fs20 c-fc-gray">长按识别二维码，添加班主任微信</p>
      <div class="c-pt60 c-flex-row c-flex-center">
        <div class="c-br30 c-fs24 c-fc-white theme-bg c-ww480 c-hh60 c-flex-row c-flex-center" @click="toActivity">返回</div>
      </div>
    </div>
  </div>
</template>
<script>
import { utilJs } from "@/utils/common.js"
export default {
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : 'mb5_default',
      from: '1', // 从哪里跳转过来
      type: '', // 类型（请求发送失败，连接超时）
      phone: '',
      teacherQrcode: '',
      teacherWechatId: ''
    }
  },
  created() {
    utilJs.appShare(this);
  },
  methods: {
    toActivity() {
      this.$routerGo(this, "push", { path: `/activity/activityIndex` })
    },
    getContact() {
      if (this.from != 3) {
        return;
      }
      let $this = this;
      // 获取联系人和班主任号码
      utilJs.getMethod(global.apiurl + 'activities/getCompanyInfo', function (res) {
        $this.phone = res.phone;
        $this.teacherQrcode = res.teacherQrcode;
        $this.teacherWechatId = res.teacherWechatId;
      });
    },
    //分享
    wechatShare: function () {
      utilJs.wechatConfig("", "", "", "", function () { });
    },
    //手机端分享
    appShare: function () {
      utilJs.appShareTrue("", "", "", "");
    }
  },
  activated() {
    setDocumentTitle("");// eslint-disable-line
    // 1 请求发送失败 或者连接超时 2 查看的活动下架 或报名的活动下架 3 已出票 报名的活动下架
    this.from = this.$route.query.from
    this.type = this.$route.query.type
    this.getContact();
  }
}
</script>
<style scoped>
</style>


